package com.newly.api.business.feign;

import com.newly.common.base.constants.ServerUriConstant;
import com.newly.common.base.entity.R;
import com.newly.common.base.entity.business.Vo.SerialVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Api(tags = "MQTT-串口配置")
@FeignClient(path = ServerUriConstant.NEWLY_BUSINESS_MQTT_Serial, name = ServerUriConstant.NEWLY_BUSINESS_SERVICE_NAME)
public interface MQTTSerialClient {

    /**
     * 获取所有串口配置
     * @return
     */
    @ApiOperation("获取所有串口配置")
    @GetMapping("/getSerials")
    R getSerials(String productKey);

    /**
     * 获取串口配置
     * @return
     */
    @ApiOperation("获取串口配置")
    @GetMapping("/getSerial")
    R getSerial(String productKey, int index);

    /**
     * 设置串口
     * @return
     */
    @ApiOperation("设置串口")
    @PostMapping("/setSerial")
    R setSerial(@RequestBody SerialVo serialVo);

}
